from django.db import models
import pandas
import numpy
# Create your models here.
#天气展示
class Climate(models.Model):

    def __init__(self):
        self.humidity="50%"
        self.pm="97"
        self.low_temperature="12℃"
        self.weather="多云"
        #my_matrix = numpy.loadtxt(open(r"./weather_data.csv","rb"),delimiter=",",skiprows=0)
        info=pandas.read_csv(r"./dataset/天气数据.csv",encoding='gb2312')
        info=info.loc[3]
        '''for i in range(len(info)):
            info[i]=info[i].encode('utf-8')'''
        self.date,self.high_temperature,self.low_temperature,self.weather,self.wind=info
